package com.inspur.edp.ai.flow.metadata.json;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;

import java.io.IOException;

/**
 * @author lizhaorui
 * @date 2025/9/15
 * @description
 */
public class JsonTypeDeserializer  extends JsonDeserializer<JsonType> {

    @Override
    public JsonType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
        JsonNode jsonNode = jsonParser.getCodec().readTree(jsonParser);
        return JsonTypeDeserializerMgr.deserialize(jsonNode);
    }
}
